load("@fbcode_macros//build_defs:cpp_benchmark.bzl", "cpp_benchmark")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")

oncall("scm_client_infra")

cpp_unittest(
    name = "task_trace_test",
    srcs = [
        "TaskTraceTest.cpp",
    ],
    supports_static_listing = False,
    deps = [
        "fbsource//third-party/googletest:gtest",
        "//eden/fs/telemetry:task_trace",
        "//folly/futures:core",
    ],
)

cpp_unittest(
    name = "activity_buffer_test",
    srcs = [
        "ActivityBufferTest.cpp",
    ],
    supports_static_listing = False,
    deps = [
        "fbsource//third-party/googletest:gtest",
        "//eden/fs/telemetry:activity_buffer",
    ],
)

cpp_benchmark(
    name = "activity_buffer_benchmark",
    srcs = [
        "ActivityBufferBenchmark.cpp",
    ],
    deps = [
        "//eden/common/utils:process",
        "//folly:exception",
        "//folly:file",
        "//folly:stop_watch",
        "//folly/init:init",
    ],
    external_deps = [
        "gflags",
    ],
)

cpp_benchmark(
    name = "bench",
    srcs = glob(
        ["*Benchmark.cpp"],
        exclude = [
            "ActivityBufferBenchmark.cpp",
        ],
    ),
    deps = [
        "fbsource//third-party/benchmark:benchmark",
        "//eden/common/telemetry:telemetry",
        "//eden/common/utils/benchharness:benchharness",
        "//folly/init:init",
        "//folly/synchronization/test:barrier",
    ],
)

cpp_unittest(
    name = "scuba_test",
    srcs = [
        "EdenStructuredLoggerTest.cpp",
    ],
    supports_static_listing = False,
    deps = [
        "fbsource//third-party/googletest:gmock",
        "fbsource//third-party/googletest:gtest",
        "//eden/common/telemetry:log_info",
        "//eden/common/telemetry:scribe_logger",
        "//eden/fs/telemetry:structured_logger",
        "//folly/json:dynamic",
    ],
)
